/**
 * 将手机号码的中间4位做成掩码
 * @param {Number||String} mobileNum
 * @returns {String}
 */
export const mobileMask = (mobileNum) => {
  const arr = (mobileNum || '').toString().split('');
  if (arr.length < 11) return mobileNum;
  const arrStar = new Array(4);
  arrStar.fill('*');
  arr.splice(-8, 4, ...arrStar);
  return arr.join('');
}
